package com.xuelang.pipeline.artifact.app.nexus3v1.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author xiwen.zxg
 * @since 2024/7/16
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CreateWebhookRepositoryResponse {

    private Integer tid;
    private String action;
    private String method;
    private ResultXO result;
    private String type;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ResultXO {
        private Boolean success;
        private DataXO data;

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DataXO {
        private String id;
        private String typeId;
        private Boolean enabled;
        private String notes;
        private PropertiesXO properties;
        private Boolean active;
        private Boolean error;
        private String description;
        private String state;
        private String stateDescription;
        private Object status; // 可以根据实际需要更改为具体的类型
        private String typeName;
        private TagXO tags;
        private String disableWarningMessage; // 根据实际情况可以更改类型或去掉
        private String deleteWarningMessage; // 根据实际情况可以更改类型或去掉

    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PropertiesXO {
        private String names; // 可能应该是 name（单数）
        private String secret;
        private String repository;
        private String url;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TagXO {
        private String Repository;
        private String Category;
    }
}
